feat: track quick-start events#205
Conversation
| m.baseUri, | ||
| "CLI Setup SDK Selected", | ||
| map[string]interface{}{ | ||
| "sdk": m.canonicalName, |
There was a problem hiding this comment.
canonicalName seems like the preferable one here as opposed to displayName.
dbolson
left a comment
There was a problem hiding this comment.
I think we can use messages and do all the tracking in the container model. That way we don't need to pass the analytics tracker into the nested models, and we can keep the tracking calls closer together.
For example,
- when we start the tea program in
quickstart.go, it calls thecreateFlagModel#Init() createFlagModel#Init()sends acreateFlagStartedMsgwithtime.Now()- container receives the message in
Update - container calls
SendSetupStartedEvent()with its current step (1) - when subsequent nested models are initialized, the send their own
{model}StartedMsg - the container receives those messages and calls
SendSetupStartedEvent()as needed
It would be helpful to write up a plan for the message flow before changing the code to prevent more back-and-forth.
| // Init sends commands when the model is created that will: | ||
| // * select an SDK if it's already been selected | ||
| func (m chooseSDKModel) Init() tea.Cmd { | ||
| m.analyticsTracker.SendSetupStartedEvent(m.accessToken, m.baseUri, viper.GetBool(cliflags.OutputFlag), "2 - sdk selection") |
There was a problem hiding this comment.
Should this be AnalyticsOptOut instead of OutputFlag, and, like before, can you pass in the value so we don't import viper into the internal packages?
There was a problem hiding this comment.
Dang, I made this mistake before. Thanks for catching it
SendSetupStartedEvent
SendSetupSDKSelectedEvent
SendSetupFlagToggledEvent
|
|
Thinking about it more, the container shouldn't directly call the tracker but should send a command that does it, similar to the The container could use |
|
Closing to break into smaller PRS #215 |
Added three new types of events:
SendSetupStartedEvent,SendSetupSDKSelectedEvent,SendSetupFlagToggledEvent